package STUDENT.LEKHUONGDUY.OOPs.Calculator;

import java.util.Scanner;

import org.w3c.dom.css.ElementCSSInlineStyle;

public class Views {
	public static void main(String[] args) {
		String Test = "";
		Scanner sc = new Scanner(System.in);
		Object obj = new Object();
		Controllers ctr = new Controllers();
		
		do {
			System.out.println("Nhập vào số a: ");
			Test = sc.nextLine();
			if (Test.isEmpty()) {
				System.out.println("Bạn chưa nhập số a !!");
			} else {
			obj.setA(Double.parseDouble(Test));
			}
		} while (Test.isEmpty());
		
		do {
			System.out.println("Nhập vào số b: ");
			Test = sc.nextLine();
			if (Test.isEmpty()) {
				System.out.println("Bạn chưa nhập số b !!");
			} else {
			obj.setB(Double.parseDouble(Test));
			}
		} while (Test.isEmpty());
		
		do {
			System.out.println("Phép tính: 1-Cộng, 2-Trừ, 3-Nhân, 4-Chia.");
			obj.setMath(sc.nextLine());
			if (obj.getMath().isEmpty()) {
				System.out.println("Bạn cần phải nhập phép tính!!");
			}
		} while (obj.getMath().isEmpty());
		
		ctr.dieuHuong(obj);
		System.out.println("Kết quả là: " + ctr.result);
	}

}
